<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>qf</title>
    <style>
        div{
            margin: 0 auto;
        }
        .parentBox{
            height: 200px;
            width: 300px;
            background-color: #f00;
        }
 
        .childBox{
            height: 200px;
            width: 200px;
            background-color: #00f;
        }
    </style>
</head>
<body>
<div class="parentBox">
    <div class="childBox"></div>
</div>
</body>
<script>
    window.onload=function(){
        var parent = document.getElementsByClassName("parentBox")[0];
        parent.addEventListener("mouseenter",function(){
            console.log("Mouse Enter enter版的移入")
        });
        parent.addEventListener("mouseleave",function(){console.log("Mouse Leave leave版的移出")});
        parent.addEventListener("mouseover",function(){ console.log("Mouse Over over版的移入")});
        parent.addEventListener("mouseout",function(){ console.log("Mouse Out out的移出")});
    }

    // 进入父元素  over enter 都会触发 
    // 离开父元素  out  leave 都会触发 

    // 从父元素 进入子元素  再由子元素进入父元素  只能触发over  out   
    // enter  leave 不触发 

</script>
</html>